Skip to content

Use <[T]>::as_chunks{_mut} for exact size chunks#23755

Merged
alice-i-cecile merged 3 commits intobevyengine:mainfrom
DavidCrossman:use_as_chunks
May 4, 2026
Merged

Use <[T]>::as_chunks{_mut} for exact size chunks#23755
alice-i-cecile merged 3 commits intobevyengine:mainfrom
DavidCrossman:use_as_chunks

Conversation

@DavidCrossman
Copy link
Copy Markdown
Contributor

Objective

  • Reduce unwraps and bounds checks.

Solution

  • Replace usages of <[T]>::chunks{_mut} and <[T]>::chunks_exact{_mut} where the size is exact with <[T]>::as_chunks{_mut}.

Testing

  • Ran cargo run -p ci -- compile

@kfc35 kfc35 added C-Code-Quality A section of code that is hard to understand or change S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Apr 11, 2026
Comment thread crates/bevy_mesh/src/mesh.rs Outdated
Comment thread crates/bevy_mesh/src/mesh.rs
Co-authored-by: Luo Zhihao <luo_zhihao@outlook.com>
@beicause beicause added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 3, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 3, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 3, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 3, 2026
Merged via the queue into bevyengine:main with commit 5d03586 May 4, 2026
40 checks passed
@DavidCrossman DavidCrossman deleted the use_as_chunks branch May 4, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants